package com.lizhi.yun.core.trajectoryInfo;/**
 * @program: hbsf_yun
 * @name RszTrajectoryInfoHandler
 * @description:
 * @author: lizhi
 * @create: 2021-11-17 09:20
 */

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.mybatis.interceptor.PageBounds;
import com.lizhi.utils.json.SamJsonUtil;
import com.lizhi.yun.db.rsz.dao.RszTrajectoryInfoDao;
import com.lizhi.yun.db.rsz.entity.RszTrajectoryInfoEntity;
import com.lizhi.yun.deploy.NewBaseHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *@program: hbsf_yun
 *@name RszTrajectoryInfoHandler
 *@description: 固定处方
 *@author: lizhi
 *@create: 2021-11-17 09:20
 */
@Slf4j
@Service
public class RszTrajectoryInfoHandler extends NewBaseHandler {

    @Resource
    private RszTrajectoryInfoDao rszTrajectoryInfoDao;

    public ListResponseResult doMain(String json){
        Map<String, Object> map = SamJsonUtil.toMap(json);
        PageBounds pageBounds = getPageBounds(map);
        List<RszTrajectoryInfoEntity> rszTrajectoryInfoEntities = rszTrajectoryInfoDao.selectByMap(map, pageBounds);
        return getListResult(pageBounds.getCountRows(), rszTrajectoryInfoEntities, map);
    }
}
